/*
 * gui.h
 */

#ifndef GUI_H_
#define GUI_H_

#ifdef __APPLE_CC__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif

/*
 * Sets up OpenGL so we can draw straight 2D on top of the already rendered
 * graphics.
 * Code originally by Jesse Lawson in a post in www.gamedev.net
 * Enhancements by Vincent David from same source
 */
void glEnable2D();

/*
 * Reverts OpenGL to state before glEnable2D was called.
 * Code originally by Dwarf with Axe (Jesse Lawson) in a post in www.gamedev.net
 */
void glDisable2D();

/*
 * Prints the given null-terminated character string on screen in the given x/y
 * location using the given font.
 * Available fonts are:
 * GLUT_BITMAP_8_BY_13 GLUT_BITMAP_9_BY_15
 * GLUT_BITMAP_TIMES_ROMAN_10 GLUT_BITMAP_TIMES_ROMAN_24
 * GLUT_BITMAP_HELVETICA_10 GLUT_BITMAP_HELVETICA_12 GLUT_BITMAP_HELVETICA_18
 */
void print_text( int x, int y, const char *string, void *font );

/*
 * Draws the texture represented by the given texture id at the given x/y
 * location.
 * NOTE: The texture id is the int returned by load_png, not the GLint of the
 * actual texture loaded.
 */
void gui_draw_texture( int x, int y, int texture );

/*
 * Draws a health bar with the given dimensions at the given location. The HP
 * values are needed only to figure out how full the health bar should be,
 * values should at minimum be at a ratio roughly equivalent to the actual
 * values.
 */
void gui_draw_healthbar( int x, int y, int width, int height, int hp, int max );

/*
 * Draws the given string at the given location with the given width, height,
 * and colors in a Times New Roman 24pt font.
 * NOTE: The width and height refer only to the dimensions of the box.
 */
void gui_draw_big_textbox( int x, int y, int width, int height,
    const GLfloat box_color[], const GLfloat trim_color[],
    const GLfloat font_color[], const char *string );

/*
 * Draws the given string at the given location with the given width, height,
 * and colors in a Helvetica 12pt font.
 * NOTE: The width and height refer only to the dimensions of the box.
 */
void gui_draw_textbox( int x, int y, int width, int height,
    const GLfloat box_color[], const GLfloat trim_color[],
    const GLfloat font_color[], const char *string );

/*
 * Loads the PNG file located at the given file name, returning an int
 * identifying the PNG in the PNG texture array.
 */
int load_png(const char *filename);

/*
 * Draws the Graphical User Interface.
 */
void drawGUI();

#endif
